
#include<bits/stdc++.h>
#define fi first
#define se second
namespace IO{
    template<typename T>
    void read(T &x){
        char ch=getchar();int fl=1;x=0;
        while(ch>'9'||ch<'0'){if(ch=='-')fl=-1;ch=getchar();}
        while(ch<='9'&&ch>='0'){x=x*10+ch-48;ch=getchar();}
        x*=fl;
    }
    template<typename T,typename ...Args>
    void read(T &x,Args& ...args){
        read(x);read(args...);
    }
    template <typename _Tp>
    void write(_Tp x) {
        if(x<0) x=(~x+1),putchar('-');
        if(x>9) write(x/10);
        putchar(x%10+'0');
    }
}
using namespace std;
using namespace IO;
const int N=1e6+5,mod=998244353;
int n,k,a[N],fac[N],inv[N],Ans=0;
int ksm(int x,int y) {
    int ans=1;
    while(y) {
        if(y&1) ans=(1ll*ans*x)%mod;
        x=(1ll*x*x)%mod; y>>=1;
    }
    return ans;
}	
inline void init() {
    fac[0]=1;
    for(int i=1;i<N;i++) fac[i]=(1ll*fac[i-1]*i)%mod;
    inv[N-1]=ksm(fac[N-1],mod-2);
    for(int i=N-2;i>=0;i--) inv[i]=(1ll*inv[i+1]*(i+1))%mod;
}
inline int Inc(int x,int y) {return x+y<mod?x+y:x+y-mod;}
inline int Dec(int x,int y) {return x>=y?x-y:x-y+mod;}
inline int Mul(int x,int y) {return (1ll*x*y)%mod;}
int p[N];
void dfs(int x) {
    if(x==k+1) {
        vector<int> vec;
        for(int i=1;i<=n;i++) 
            vec.push_back(a[i]);
        for(int i=1;i<=k;i++) {
            vector<int> to;
            for(int j=0;j<vec.size();j++) {
                if(j==p[i]) continue;
                if(j==p[i]-1) to.push_back(Dec(vec[i],vec[i+1]));
                else to.push_back(vec[i]);
            }
            vec=to;
        }
        for(int i=0;i<vec.size();i++) Ans=Inc(Ans,vec[i]);
        return ;
    }
    for(int i=1;i<=n-x;i++) {
        p[x]=i;
        dfs(x+1);
    }
}
inline int C(int x,int y) {
    if(x<0 || y<0 || x<y) return 0;
    return Mul(fac[x],Mul(inv[y],inv[x-y]));
}
signed main() {
#ifndef KAxdd
#ifndef ONLINE_JUDGE
    freopen("game.in","r",stdin);
    freopen("game.out","w",stdout);
#endif
#endif
    read(n,k);
    for(int i=1;i<=n;i++) read(a[i]);
    init();
    dfs(1);int res=1;
    for(int i=n-1;i>=n-k;i--) res=Mul(res,ksm(i,mod-2));
    printf("%d\n",Mul(Ans,res));
    return 0;
}
/*

*/